package com.briup.day07.bean;

public class Account {
    public static void main(String[] args) {
        //
    }
    //将成员变量隐藏，对外提供公共方法
    private String id;
    private double balance;
    public void setId(String id) {
        this.id=id;
    }
    public String getId() {
        return id;
    }
    public double withdraw(double awt) {
        if(awt<=balance&&awt>0){
            balance=balance-awt;
        }
        return balance;
    }
    //定义存钱方法
    public void setBalance(double balance){
        this.balance=balance;
    }
    public double getBalance(String msg) {
        System.out.println(msg);
        return balance;
    }
    public void show(){
        System.out.println("银行卡号"+id);
        System.out.println("银行卡余额"+balance);
        System.out.println("银行卡余额"+this.getBalance("hello"));
    }
}
